import React from 'react';
import ReactDOM from 'react-dom';
import 'bootstrap/dist/css/bootstrap.min.css';
import App from './App';
// 导入store仓储对象
import store from './redux/store';

// 导入Provider容器组件
import { Provider } from 'react-redux';

render();

// 监听数层的更新, 通过回调函数重新渲染页面
store.subscribe(()=>{
  render();
});

function render(){
  ReactDOM.render(
    <Provider store={store}><App /></Provider>,
    document.getElementById('root')
  );
}